<?php
include LIB_PATH . 'Action/YAction.class.php';
class AboutAction extends YAction {
	public function __construct() {
		parent::__construct();
	}

    public function index(){
		$data = D('About')->getList();
		$this->assign('data', $data);
		
		$data = end($data);
		$lastId = $data['id'];
		$this->assign('lastId', $lastId);
		
		$this->display();
    }
	
	// ajax loadMore
	public function ajax_loadMore() {
		$lastId = $_GET['lastId'];
		if(!is_numeric($lastId)) die('4');
		
		$data = array();
		$data = D('About')->loadMore($lastId, 2);	
		$this->assign('data', $data);
		
		$this->display('loadMore');
	}
}